home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!news
- From: jlilley@ix.netcom.com (John Lilley)
- Newsgroups: comp.lang.c++
- Subject: Re: dynamic binding in C++
- Date: 1 Apr 1996 00:06:50 GMT
- Organization: Netcom
- Message-ID: <4jn6mq$sls@dfw-ixnews1.ix.netcom.com>
- References: <4j9dq7$4f@larch.cc.swarthmore.edu> <315C871E.22F8@aai.arco.com>
- NNTP-Posting-Host: den-co16-05.ix.netcom.com
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=US-ASCII
- X-NETCOM-Date: Sun Mar 31 6:06:50 PM CST 1996
- X-Newsreader: WinVN 0.99.7
-
- In article <315C871E.22F8@aai.arco.com>, lasbfl@aai.arco.com says...
-
- >>Mark Tong '99 wrote:
- >> Anybody knows whether C++ is capable of dynamic binding?
-
- >It is possible, but I believe it is implementation dependent.
- >I have not done it myself, but I have seen a massive manual
- >from IBM for their AIX systems which explains how to do it
- >on their systems.
-
- Dynamic *loading* (i.e., binding an entire class by name at runtime), if
- that's what you mean, can be done with a DLL on Windows 95/NT. It's pretty
- much just a matter of writing a class, making all of the methods that you care
- about virtual, and then exporting two "C" functions that create and destroy
- the objects by pointer. Then you load the "C" functions by name from the DLL
- at runtime. Call the "C" create function by pointer to create an object.
- Once you have a pointer to an object, all the the virtual methods work
- automatically. Of course, you cannot make them automatic variables, but that
- is the case with most dynamic binding.
-
- john lilley
-
-